<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/Sanpham.php';
$timsp = new Sanpham();
$listtimsp = $timsp->timSanPham($timkiem);
?>
<div class="form">
    <form method="post" action="sanpham.php?ava=list">
        <input name="txttimkiemsp" type="text" class="colortext"  value="Tên sản phẩm..." />
        <input type="submit" name="timkiem" value="GO">
    </form>
</div>
<link href="admin.css" rel="stylesheet">
<div style="margin: 5px;padding: 30px;">
    <h2 style="color: #0000cc" align="center">Danh sách sản phẩm</h2>
    <div class="command_area">
        <a href="/admin/capnhatsanpham.php">Thêm mới sản phẩm</a>
    </div>
    <table style="width: 100%">
        <thead>
            <tr>
                <th scope="col" align="left">ID</th>
                <th scope="col" align="left">Tên sản phẩm</th>
                <th scope="col" align="left">Giá</th>
                <th scope="col" align="left">Mô tả</th>
                <th scope="col" align="left">Đặc biệt</th>
                <th scope="col" align="left">Hình ảnh</th>
                <th scope="col" align="left">Trạng thái</th>
                <th scope="col"></th>
                <th scope="col"></th>
            </tr>
        </thead>
        <tbody>
            <?php while ($sp = mysql_fetch_assoc($listtimsp)): ?>
                <tr>
                    <td scope="col"><?php echo $sp['id'] ?></td>
                    <td scope="col"><?php echo $sp['ten'] ?></td>
                    <td scope="col"><?php echo $sp['gia'] ?></td>
                    <td scope="col"><?php echo $sp['mota'] ?></td>
                    <td scope="col"><?php echo $sp['dacbiet'] ?></td>
                    <td scope="col"><img src="<?php echo $sp['hinhanh'] ?>" width="120px;"  /> </td>
                    <td scope="col"><?php echo $sp['trangthai'] ?></td>
                    <td scope="col"><?php echo "<a href='/admin/capnhatsanpham.php?id=" . $sp['id'] . "'>Sửa"; ?></td>
                    <td scope="col"><?php echo "<a href='/admin/sanpham.php?command=del&id=" . $sp['id'] . "'>Xóa"; ?></td>                   
                </tr>
            <?php endwhile; ?>
        </tbody>
        <tfoot>
            <tr>
                <th scope="row" colspan="11"><p style="color: #0099ff">.:Danh Mục Sản Phẩm:.</p></th>
        </tr>
        </tfoot>
    </table>
</div>
